package cn.schoolwow.quickserver.controller;

import cn.schoolwow.quickserver.request.HttpRequest;
import cn.schoolwow.quickserver.response.HttpResponse;
import cn.schoolwow.quickserver.session.HttpSession;
import org.springframework.stereotype.Component;

@Component
public class ExceptionHandlerConfig implements ExceptionHandler{
    @Override
    public Object beforeBodyWrite(Throwable throwable, HttpRequest httpRequest, HttpResponse httpResponse, HttpSession httpSession) {
        throwable.printStackTrace();
        return throwable.getMessage();
    }
}
